package com.tj.collection.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.tj.collection.db.dao.DataArchivingDao;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: pavan
 * Date: 2020/3/12
 * Time: 下午3:14
 */
@Repository
public class DataArchivingDaoImpl extends AbstractBaseMapper implements DataArchivingDao {

    @Override
    public Integer countSql(String sql) {
        Map<String, Object> params = new HashMap<>();
        params.put("sql", sql);
        return getSqlSession().selectOne(getStatement("countSql"), params);
    }

    @Override
    public Integer executeSql(String sql) {
        Map<String, Object> params = new HashMap<>();
        params.put("sql", sql);
        return getSqlSession().update(getStatement("executeSql"), params);
    }
}
